// 全局样式文件

// 重置样式
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #1f2937;
  background-color: #f7f8fa; /* 纯色背景 */
}

:root {
  --color-primary: #3b82f6;  /* 蓝 */
  --color-success: #22c55e;  /* 绿 */
  --color-danger:  #ef4444;  /* 红 */
  --color-warning: #f59e0b;  /* 橙 */
  --color-info:    #64748b;  /* 灰蓝 */
  --color-muted:   #6b7280;
  --color-border:  #e5e7eb;
  --color-card:    #ffffff;
  --shadow-soft:   0 4px 16px rgba(0, 0, 0, 0.06);
}

#app {
  height: 100%;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  
  &:hover {
    background: #a8a8a8;
  }
}

// 工具类
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.ml-1 {
  margin-left: 8px;
}

.ml-2 {
  margin-left: 16px;
}

.mr-1 {
  margin-right: 8px;
}

.mr-2 {
  margin-right: 16px;
}

.p-1 {
  padding: 8px;
}

.p-2 {
  padding: 16px;
}

.p-3 {
  padding: 24px;
}

.px-1 {
  padding-left: 8px;
  padding-right: 8px;
}

.px-2 {
  padding-left: 16px;
  padding-right: 16px;
}

.py-1 {
  padding-top: 8px;
  padding-bottom: 8px;
}

.py-2 {
  padding-top: 16px;
  padding-bottom: 16px;
}

// 颜色类
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info    { color: var(--color-info); }
.text-primary { color: var(--color-primary); }

.bg-success {
  background-color: #67c23a;
}

.bg-danger {
  background-color: #f56c6c;
}

.bg-warning {
  background-color: #e6a23c;
}

.bg-info {
  background-color: #909399;
}

.bg-primary {
  background-color: #409eff;
}

// 卡片样式
.card {
  background: var(--color-card);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  padding: 16px;
  margin-bottom: 16px;
  
  &.card-hover {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    
    &:hover {
      box-shadow: 0 8px 22px rgba(0,0,0,0.08);
      transform: translateY(-2px);
    }
  }
}

// 统计卡片
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  
  .stat-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
  }
  
  .stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 4px;
  }
  
  .stat-change {
    font-size: 12px;
    opacity: 0.8;
  }
}

// 数据表格样式
.data-table {
  .el-table {
    border-radius: 8px;
    overflow: hidden;
    
    .el-table__header {
      background-color: #fafafa;
    }
    
    .el-table__row {
      &:hover {
        background-color: #f5f7fa;
      }
    }
  }
  
  .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    
    .table-title {
      font-size: 18px;
      font-weight: 600;
      color: #303133;
    }
    
    .table-actions {
      display: flex;
      gap: 12px;
      align-items: center;
    }
  }
}

// 加载状态
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #909399;
}

// 空状态
.empty-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #909399;
  
  .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
  }
  
  .empty-text {
    font-size: 16px;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .stat-card {
    padding: 20px;
    
    .stat-value {
      font-size: 24px;
    }
  }
  
  .data-table {
    .table-header {
      flex-direction: column;
      gap: 12px;
      align-items: stretch;
      
      .table-actions {
        justify-content: center;
        flex-wrap: wrap;
      }
    }
  }
}

@media (max-width: 480px) {
  body {
    font-size: 12px;
  }
  
  .card {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .stat-card {
    padding: 16px;
    
    .stat-value {
      font-size: 20px;
    }
  }
}

// 动画
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

// 自定义Element Plus样式覆盖
.el-button {
  border-radius: 6px;
}

.el-card {
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.el-input {
  .el-input__wrapper {
    border-radius: 6px;
  }
}

.el-select {
  .el-input__wrapper {
    border-radius: 6px;
  }
}